from enum import Enum

from pydantic import BaseModel, validator, ValidationError


class StatusTypes(Enum):
    NotForwarded = "1"  # 转发
    Forwarded_500 = "2" # 模拟接口500报错
    Forwarded = "3"  # 模拟接口code报错
    NoSource = "4"  # 调度返回无资源
    ExistSource = "5"  # 资源已存在
    InnerErroe = "6"  # 调度内部异常

class RedisData(BaseModel):
    status_type: StatusTypes =1
    timeout: str = "5"
    time_count: str = "0"
    error_count: str = "0"